import time
import os

import cv2

from grabscreen import grab_screen


# x1, y1 = int(958 - 48 / 2), int(1003 - 48 / 2)
# x2, y2 = int(958 + 48 / 2), int(1003 + 48 / 2)

x1, y1 = int(958 - 32 / 2), int(1006 - 32 / 2)
x2, y2 = int(958 + 32 / 2), int(1006 + 32 / 2)

time.sleep(3)

while True:

    img0 = grab_screen(region=(x1, y1, x2, y2))

    filename = os.path.join(r'C:\Programs\workspace\deep_learning\data\pubg\OCR_bullet_count', str(time.time())+'.jpg')

    cv2.imwrite(filename, img0)

    time.sleep(0.086)
